<template>
  <div id="speak">
    <slid :s='img'></slid>
    <four></four>
    <div data-am-widget="intro" class="am-intro am-cf am-intro-default">
      <div class="am-intro-hd">
        <h2 class="am-intro-title">功效</h2>
      </div>
      <div v-for="item in speak" :key='item.ID' class="am-g am-intro-bd">
        <router-link :to="'/detail/'+item.ID">
          <a href="javascript:;">
            <div class="am-intro-left am-u-sm-3"><img :src="item.src" /></div>
            <div class="am-intro-right am-u-sm-9">
              <h2>{{item.h2}}</h2>
              <p>{{item.p}}</p>
              <div class="text">
                <span class="fl">2017-5-23</span>
                <span class="fr"><i class="am-icon-thumbs-o-up"></i>&nbsp;点赞</span>
              </div>
            </div>
          </a>
        </router-link>
      </div>
  
    </div>
  </div>
</template>

<script>
  import four from "./four";
  import slid from "./slide";
  export default {
    data() {
      return {
        img: [
          "/src/assets/images/banner3.png",
          "/src/assets/images/banner4.png",
          "/src/assets/images/banner3.png"
        ],
        speak: []
      };
    },
    created() {
      this.$http({
          // url:'/data/news.data'
          url: "http://localhost:9527/speaks"
        })
        .then(res => {
          this.speak = res.data;
          // console.log(res);
          // console.log(res.data);
          // console.log(this.speak);
          // console.log(this.newslist)
        })
        .catch(res => {
          console.log("speak.data error");
        });
    },
    components: {
      four,
      slid
    }
  };
</script>

<style scoped>
  .my-swipe {
    height: 164px;
  }
</style>